<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>libwebsockets: Miscellaneous APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="libwebsockets.org-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libwebsockets
   </div>
   <div id="projectbrief">Lightweight C library for HTML5 websockets</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__misc.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Miscellaneous APIs</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9f37d0e357de2ab4170723fcdb665d21"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#ga9f37d0e357de2ab4170723fcdb665d21">lws_snprintf</a> (char *str, size_t size, const char *format,...)</td></tr>
<tr class="separator:ga9f37d0e357de2ab4170723fcdb665d21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga58f906c6be0ca80efd813f694569dd4a"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#ga58f906c6be0ca80efd813f694569dd4a">lws_get_random</a> (struct lws_context *context, void *buf, int len)</td></tr>
<tr class="separator:ga58f906c6be0ca80efd813f694569dd4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gace5171b1dbbc03ec89a98f8afdb5c9af"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#gace5171b1dbbc03ec89a98f8afdb5c9af">lws_daemonize</a> (const char *_lock_path)</td></tr>
<tr class="separator:gace5171b1dbbc03ec89a98f8afdb5c9af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac6abfc0b2bd5b2f09281a4432bb2f5f0"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN const char *LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#gac6abfc0b2bd5b2f09281a4432bb2f5f0">lws_get_library_version</a> (void)</td></tr>
<tr class="separator:gac6abfc0b2bd5b2f09281a4432bb2f5f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa194584fff9698f3b280658f770ccd0f"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#gaa194584fff9698f3b280658f770ccd0f">lws_wsi_user</a> (struct lws *wsi)</td></tr>
<tr class="separator:gaa194584fff9698f3b280658f770ccd0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1ec0d9faac5d3a5824d765c287c043aa"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#ga1ec0d9faac5d3a5824d765c287c043aa">lws_parse_uri</a> (char *p, const char **prot, const char **ads, int *port, const char **path)</td></tr>
<tr class="separator:ga1ec0d9faac5d3a5824d765c287c043aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga33bf2635033710b25f931b57ed663e1e"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#ga33bf2635033710b25f931b57ed663e1e">lws_now_secs</a> (void)</td></tr>
<tr class="separator:ga33bf2635033710b25f931b57ed663e1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0af4f7d2dd375aeedcfa7eb0e1101c4b"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws_context *LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#ga0af4f7d2dd375aeedcfa7eb0e1101c4b">lws_get_context</a> (const struct lws *wsi)</td></tr>
<tr class="separator:ga0af4f7d2dd375aeedcfa7eb0e1101c4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga629f48268fd1856b54b11172991b97d9"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#ga629f48268fd1856b54b11172991b97d9">lws_get_count_threads</a> (struct lws_context *context)</td></tr>
<tr class="separator:ga629f48268fd1856b54b11172991b97d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8930fe36a3f3eefe4a6a4fd499d8e899"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#ga8930fe36a3f3eefe4a6a4fd499d8e899">lws_get_parent</a> (const struct lws *wsi)</td></tr>
<tr class="separator:ga8930fe36a3f3eefe4a6a4fd499d8e899"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacae4d7b6a8d22e4c2d82ff8b12c1e234"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#gacae4d7b6a8d22e4c2d82ff8b12c1e234">lws_get_child</a> (const struct lws *wsi)</td></tr>
<tr class="separator:gacae4d7b6a8d22e4c2d82ff8b12c1e234"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e705d498e8c8500649a26ba30a1e106"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0e705d498e8c8500649a26ba30a1e106"></a>
LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><b>lws_read</b> (struct lws *wsi, unsigned char *buf, size_t len)</td></tr>
<tr class="separator:ga0e705d498e8c8500649a26ba30a1e106"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab321ed812f46f6dc7ef9e3ca6f00cf1b"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__misc.html#gab321ed812f46f6dc7ef9e3ca6f00cf1b">lws_set_allocator</a> (void *(*realloc)(void *ptr, size_t size))</td></tr>
<tr class="separator:gab321ed812f46f6dc7ef9e3ca6f00cf1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2>Miscellaneous APIs</h2>
<p>Various APIs outside of other categories </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gace5171b1dbbc03ec89a98f8afdb5c9af"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_daemonize </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>_lock_path</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#gace5171b1dbbc03ec89a98f8afdb5c9af">lws_daemonize()</a>: fill a buffer with platform random data</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">_lock_path</td><td>the filepath to write the lock file</td></tr>
  </table>
  </dd>
</dl>
<p>Spawn lws as a background process, taking care of various things </p>

</div>
</div>
<a class="anchor" id="gacae4d7b6a8d22e4c2d82ff8b12c1e234"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN struct lws* LWS_WARN_UNUSED_RESULT lws_get_child </td>
          <td>(</td>
          <td class="paramtype">const struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#gacae4d7b6a8d22e4c2d82ff8b12c1e234">lws_get_child()</a> - get child wsi or NULL </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>lws connection</td></tr>
  </table>
  </dd>
</dl>
<p>Allows you to find a related wsi from the parent wsi. </p>

</div>
</div>
<a class="anchor" id="ga0af4f7d2dd375aeedcfa7eb0e1101c4b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN struct lws_context* LWS_WARN_UNUSED_RESULT lws_get_context </td>
          <td>(</td>
          <td class="paramtype">const struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p>lws_get_context - Allow geting lws_context from a Websocket connection instance</p>
<p>With this function, users can access context in the callback function. Otherwise users may have to declare context as a global variable.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>Websocket connection instance </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga629f48268fd1856b54b11172991b97d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_get_count_threads </td>
          <td>(</td>
          <td class="paramtype">struct lws_context *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#ga629f48268fd1856b54b11172991b97d9">lws_get_count_threads()</a>: how many service threads the context uses</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>the lws context</td></tr>
  </table>
  </dd>
</dl>
<p>By default this is always 1, if you asked for more than lws can handle it will clip the number of threads. So you can use this to find out how many threads are actually in use. </p>

</div>
</div>
<a class="anchor" id="gac6abfc0b2bd5b2f09281a4432bb2f5f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN const char* LWS_WARN_UNUSED_RESULT lws_get_library_version </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#gac6abfc0b2bd5b2f09281a4432bb2f5f0">lws_get_library_version()</a>: return string describing the version of lws</p>
<p>On unix, also includes the git describe </p>

</div>
</div>
<a class="anchor" id="ga8930fe36a3f3eefe4a6a4fd499d8e899"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN struct lws* LWS_WARN_UNUSED_RESULT lws_get_parent </td>
          <td>(</td>
          <td class="paramtype">const struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#ga8930fe36a3f3eefe4a6a4fd499d8e899">lws_get_parent()</a> - get parent wsi or NULL </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>lws connection</td></tr>
  </table>
  </dd>
</dl>
<p>Specialized wsi like cgi stdin/out/err are associated to a parent wsi, this allows you to get their parent. </p>

</div>
</div>
<a class="anchor" id="ga58f906c6be0ca80efd813f694569dd4a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_get_random </td>
          <td>(</td>
          <td class="paramtype">struct lws_context *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#ga58f906c6be0ca80efd813f694569dd4a">lws_get_random()</a>: fill a buffer with platform random data</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>the lws context </td></tr>
    <tr><td class="paramname">buf</td><td>buffer to fill </td></tr>
    <tr><td class="paramname">len</td><td>how much to fill</td></tr>
  </table>
  </dd>
</dl>
<p>This is intended to be called from the LWS_CALLBACK_RECEIVE callback if it's interested to see if the frame it's dealing with was sent in binary mode. </p>

</div>
</div>
<a class="anchor" id="ga33bf2635033710b25f931b57ed663e1e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN unsigned long lws_now_secs </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#ga33bf2635033710b25f931b57ed663e1e">lws_now_secs()</a>: return seconds since 1970-1-1 </p>

</div>
</div>
<a class="anchor" id="ga1ec0d9faac5d3a5824d765c287c043aa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_parse_uri </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>prot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>ads</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p>lws_parse_uri: cut up prot:/ads:port/path into pieces Notice it does so by dropping '\0' into input string and the leading / on the path is consequently lost</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>incoming uri string.. will get written to </td></tr>
    <tr><td class="paramname">prot</td><td>result pointer for protocol part (<a href="https://">https://</a>) </td></tr>
    <tr><td class="paramname">ads</td><td>result pointer for address part </td></tr>
    <tr><td class="paramname">port</td><td>result pointer for port part </td></tr>
    <tr><td class="paramname">path</td><td>result pointer for path part </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gab321ed812f46f6dc7ef9e3ca6f00cf1b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN void lws_set_allocator </td>
          <td>(</td>
          <td class="paramtype">void *(*)(void *ptr, size_t size)&#160;</td>
          <td class="paramname"><em>realloc</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#gab321ed812f46f6dc7ef9e3ca6f00cf1b">lws_set_allocator()</a> - custom allocator support</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">realloc</td><td>Allows you to replace the allocator (and deallocator) used by lws </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga9f37d0e357de2ab4170723fcdb665d21"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_snprintf </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#ga9f37d0e357de2ab4170723fcdb665d21">lws_snprintf()</a>: snprintf that truncates the returned length too</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>destination buffer </td></tr>
    <tr><td class="paramname">size</td><td>bytes left in destination buffer </td></tr>
    <tr><td class="paramname">format</td><td>format string </td></tr>
    <tr><td class="paramname">...</td><td>args for format</td></tr>
  </table>
  </dd>
</dl>
<p>This lets you correctly truncate buffers by concatenating lengths, if you reach the limit the reported length doesn't exceed the limit. </p>

</div>
</div>
<a class="anchor" id="gaa194584fff9698f3b280658f770ccd0f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN void* lws_wsi_user </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__misc.html#gaa194584fff9698f3b280658f770ccd0f">lws_wsi_user()</a> - get the user data associated with the connection </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>lws connection</td></tr>
  </table>
  </dd>
</dl>
<p>Not normally needed since it's passed into the callback </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
